package gang.org.springframework.boot.autoconfigure.web.servlet;

import gang.org.springframework.boot.web.servlet.GangServletContextInitializer;
import gang.org.springframework.framework.core.annotation.GangOrdered;

import javax.servlet.ServletContext;

/**
 * @Author：gang.chen
 * @Date：2023/10/13 9:31
 */
public abstract class GangRegistrationBean implements GangServletContextInitializer, GangOrdered {

    @Override
    public void onStartup(ServletContext servletContext) {

        String description = getDescription();

        register(description, servletContext);
    }

    @Override
    public int getOrder() {
        return 0;
    }


    public abstract String getDescription();

    protected  abstract void register(String description, ServletContext servletContext);
}
